#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n, x, target;
	map<int, int> mp;
	cin>>n;
	for(int i = 1;i <= n;i++)
	{
		cin>>x;
		mp[x]++;
	}
	cin>>target;
	for(auto i = mp.begin();i != mp.end();i++)
	{
		i->second--;
		auto idx = mp.find(target-(i->first));
		if(idx != mp.end() && idx->second)
		{
			cout<<min(i->first, target-(i->first))<<" "<<max(i->first, target-(i->first));
			cout<<endl;
			system("pause");
			return 0;
		}
		i->second++;
	}
	cout<<"No";
	cout<<endl;
	system("pause");
	return 0;
}

